<?php

namespace App\Http\Controllers\PC\Agent;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Service\Agent\AgentService;

class AgentController extends Controller
{
    private  $agent;
    public function __construct(AgentService $agent)
    {
        $this->agent = $agent;
    }


    public function getInvitebAgentView()
    {
        $title="诚邀代理";
        return view('PC.Agent.invite')->with('title',$title);
    }

    public function doAgentRegister(Request $request)
    {
        $where = [];
        $where['username'] = $request->input('username');
        $where['password'] = $request->input('password');
        $where['mobile'] = $request->input('mobile');
        $where['code'] = $request->input('code');

        $data = $this->agent->AgentRegister($where);
        return response()->json($data);
    }
    
}
